home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / basic / AmosBlitz_src.lha / Sourcecodes / Cheatfinder.asc next >
Encoding:
Text File  |  1996-06-13  |  1.9 KB  |  78 lines

  1. WBStartup
  2. WbToScreen 0
  3. Window        0,0,11,402,125,$1000|$2|$4|$8,"Cheatfinder 3.0 Copyright 1996 Frank Otto",1,2
  4. GTButton      0,0,15,7,125,14,"Load game",$0010
  5. GTButton      0,1,151,7,230,14,"View",$0010
  6. GTCheckBox    0,2,15,27,26,11,"Everything",$0002
  7. GTInteger     0,3,151,27,125,15,"Cheat length",$0002,5
  8. GTCheckBox    0,4,15,43,26,11,"Uppercase",$0102
  9. GTString      0,5,151,49,125,15,"Output file",$0002,99,"Ram:Cheats"
  10. GTCheckBox    0,6,15,59,26,11,"Lowercase",$0102
  11. GTString      0,7,151,71,125,15,"Text viewer",$0002,99,"Sys:Utilities/More"
  12. GTCheckBox    0,8,15,75,26,11,"Numbers",$0102
  13. GTText        0,9,15,92,366,12,"",$0010,""
  14. AttachGTList  0,0
  15.  
  16. Repeat
  17.   comm$=GTGetString(0,7)
  18.   name$=GTGetString(0,5)
  19.   Use Window 0
  20.   ev.l=WaitEvent
  21.   If ev=$40
  22.     If GadgetHit=0 AND GTGetInteger(0,3)>0 AND name$=""=0 Then Gosub loadgame
  23.     If GadgetHit=0 AND name$="" Then GTSetString 0,9,"No output file entered."
  24.     If GadgetHit=0 AND GTGetInteger(0,3)=0 Then GTSetString 0,9,"Cheat length must be over 0."
  25.     If GadgetHit=1
  26.       If Exists(name$) AND name$=""=0 Then Execute_ comm$+Chr$(32)+name$,0,Output_
  27.       If Exists(name$)=0 OR name$="" Then GTSetString 0,9,"File not found."
  28.     EndIf
  29.   EndIf
  30. Until ev=$200
  31.  
  32. Free Window 0
  33. End
  34.  
  35. loadgame:
  36. MaxLen pa$=160
  37. MaxLen fi$=64
  38. f$=ASLFileRequest$("Load game",pa$,fi$)
  39. If f$
  40. If ReadFile(1,f$)
  41. FileInput 1
  42. cheatlength=GTGetInteger(0,3)
  43. If WriteFile(2,name$)
  44. ScreensBitMap 0,0
  45. BitMapOutput 0
  46. GTSetString 0,9,"Searching..."
  47.  
  48. While NOT Eof(1)
  49. a$=Edit$(1)
  50. If Asc(a$)>96 AND Asc(a$)<123 AND GTStatus(0,6)=1 Then Goto le
  51. If Asc(a$)>64 AND Asc(a$)<91 AND GTStatus(0,4)=1 Then Goto le
  52. If Asc(a$)>47 AND Asc(a$)<58 AND GTStatus(0,8)=1 Then Goto le
  53. If Asc(a$)>31 AND GTStatus(0,2)=1 Then Goto le
  54. FileOutput 2
  55. If w>=cheatlength Then NPrint w$
  56.  
  57. w=0
  58. w$=""
  59. Goto a
  60. le:
  61. w+1
  62. w$+a$
  63. a:
  64. Wend
  65.  
  66. DefaultOutput
  67. WindowOutput 0
  68. GTSetString 0,9,"Ready."
  69. If Lof(2)=0 Then GTSetString 0,9,"Nothing found."
  70. CloseFile 1
  71. CloseFile 2
  72. EndIf
  73. EndIf
  74. EndIf
  75.  
  76. Return
  77.  
  78.